package org.ttitfly.ttcore.util.query;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class SearchObject implements Serializable, Pagable, Sortable {

    private static final long serialVersionUID = 1L;

    private int currentPage;

    private int pageSize;

    private List<Sort> sorts = new LinkedList<Sort>();

    private boolean exportFull;

    private Long domainId;

    private List<Integer> pageSizeList = new ArrayList<Integer>();

    private int exportLimit;

    /**
     * 搜索区域隐藏用
     */
    private boolean firstAccess;
    
    private Long accountId;
    
    private Long orgId;
    
    private String orgTreePath;

    public String getOrgTreePath() {
        return orgTreePath;
    }

    public void setOrgTreePath(String orgTreePath) {
        this.orgTreePath = orgTreePath;
    }

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        this.accountId = accountId;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public boolean isExportFull() {
        return exportFull;
    }

    public void setExportFull(boolean exportFull) {
        this.exportFull = exportFull;
    }

    public void addSort(Sort sort) {
        sorts.add(sort);
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public Long getDomainId() {
        return domainId;
    }

    public void setDomainId(Long domainId) {
        this.domainId = domainId;
    }

    public List<Sort> getSorts() {
        return sorts;
    }

    public void setSorts(List<Sort> sorts) {
        this.sorts = sorts;
    }

    public List<Integer> getPageSizeList() {
        if (pageSizeList.size() == 0) {
            pageSizeList.add(5);
            pageSizeList.add(10);
            pageSizeList.add(15);
            pageSizeList.add(30);
            pageSizeList.add(50);
            pageSizeList.add(100);
            pageSizeList.add(200);
        }
        return pageSizeList;
    }

    public int getExportLimit() {
        return exportLimit;
    }

    public void setExportLimit(int exportLimit) {
        this.exportLimit = exportLimit;
    }

    public boolean isFirstAccess() {
        return firstAccess;
    }

    public void setFirstAccess(boolean firstAccess) {
        this.firstAccess = firstAccess;
    }

}
